package net.wofly.sale.stock.domain;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wofly.sale.commodity.domain.Brand;
import net.wofly.sale.commodity.domain.Commodity;
import net.wofly.sale.commodity.domain.CommodityTerminal;
import net.wofly.sale.commodity.domain.CommodityType;

/**
 * 商品库存
 * @author lign
 * @version 1.0
 * @created 11-10月-2017 21:17:45
 */
@Data
@Entity
@Table(name = "sale_stock_stock")
@ApiModel(description = "商品库存")
public class Stock {
	
	@Id
	private String stockID;
	@ApiModelProperty(value = "终端商品ID")
	private String commodityTerminalID;
	private Long modifyDate;
	@ApiModelProperty(value = "库存数量")
	private Integer num = 0 ;
	@ApiModelProperty(value = "仓库ID")
	private String warehouseID;
	
	@Transient
	private CommodityTerminal commodityTerminal ;
	
	@Transient
	private Commodity commodity ;

	@Transient
	@ApiModelProperty(value = "商品编码")
	private String commodityCode;

	@Transient
	@ApiModelProperty(value = "商品名称")
	private String commodityName;

	/**
	 * 商品中图  长度：100
	 */
	@Transient
	@ApiModelProperty(value = "商品中图", required = true)
	private String commodityPic;
	/**
	 * 商品大图  长度：100
	 */
	@Transient
	@ApiModelProperty(value = "商品大图", required = true)
	private String commodityPicBig;
	/**
	 * 商品小图  长度：100
	 */
	@Transient
	@ApiModelProperty(value = "商品小图", required = true)
	private String commodityPicSmall;
	
	@Transient
	@ApiModelProperty(value = "商品类型", required = true)
	private CommodityType commodityType ;
	
	@Transient
	@ApiModelProperty(value = "商品品牌", required = true)
	private Brand brand ;
	
	public Stock(){
		
	}
	@Override
	public void finalize() throws Throwable {
		
	}
	
	@Override
	public Stock clone() throws CloneNotSupportedException {
		return (Stock) super.clone();
	}
}